<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <style>
        div{
            text-align: center;
            margin-top: 100px;
        }
        input{
            width: 500px;
            height: 40px;
            box-sizing: border-box;
        }
        button{
            width: 80px;
            height: 40px;
        }
    </style>
</head>
<body>
    <div>
        <input type="text" name="" id="" placeholder="音乐/歌曲/歌手">
        <button>搜索</button>
    </div>
    <script>
        document.querySelector('button').addEventListener('click',function(){
            let artists = document.querySelector('input').value;
            if(artists){
                // 将这个值存入本地存储
                localStorage.setItem('singerName',JSON.stringify(artists));
                // 跳转页面
                location.href = './detail.html';
            }
           
        })
    </script>
</body>
</html>